<?php
/**
 * Created by PhpStorm.
 * User: geolo
 * Date: 2018/8/7
 * Time: 17:47
 */

defined('YII_RUN') or exit('Access Denied');
/* @var $list \app\models\MailSetting */
$urlManager = Yii::$app->urlManager;
$this->title = '直播管理';
$this->params['active_nav_group'] = 1;
$url =  Yii::$app->request->hostInfo.'wz/addons/zjhj_mall/core/verdor/layDate/laydate.js';
?>

<div class="panel mb-3">
    <div class="panel-header"><?= $this->title ?>直播管理</div>
    <div class="panel-body">
        <form class="auto-form" method="post">
            <div class="form-group row">
                <div class="form-group-label col-sm-2 text-right">
                    <label class="col-form-label">开启直播管理</label>
                </div>
                <div class="col-sm-6">
                    <label class="radio-label">
                        <input id="radio2" <?= $type == 0 ? 'checked' : null ?>
                               value="0"
                               name="status" type="radio" class="custom-control-input">
                        <span class="label-icon"></span>
                        <span class="label-text">关闭</span>
                    </label>
                    <label class="radio-label">
                        <input id="radio1" <?= $type == 1 ? 'checked' : null ?>
                               value="1"
                               name="status" type="radio" class="custom-control-input">
                        <span class="label-icon"></span>
                        <span class="label-text">开启</span>
                    </label>
                </div>
            </div>
            <div class="form-group row">
                <div class="form-group-label col-sm-2 text-right">
                    <label class="col-form-label">直播时间</label>
                </div>
                <div>
                    <div class="input-group">
                        <input class="form-control" id="date_start" name="begin_time"
                               autocomplete="off"
                               value="<?= isset($begin_time) ? trim($begin_time) : '' ?>">
                        <span class="input-group-btn">
                                            <a class="btn btn-secondary" id="show_date_start" href="javascript:">
                                                <span class="iconfont icon-daterange"></span>
                                            </a>
                                        </span>
                        <span class="middle-center" style="padding:0 4px">至</span>
                        <input class="form-control" id="date_end" name="end_time"
                               autocomplete="off"
                               value="<?= isset($end_time) ? trim($end_time) : '' ?>">
                        <span class="input-group-btn">
                                            <a class="btn btn-secondary" id="show_date_end" href="javascript:">
                                                <span class="iconfont icon-daterange"></span>
                                            </a>
                                        </span>
                    </div>
                </div>
            </div>
                <div class="form-group row">
                <div class="form-group-label col-sm-3 text-right">
                    <label class="col-form-label required">主播图片</label>
                </div>
                <div class="col-sm-9">

                    <div class="col-9">
                        <div class="upload-group short-row">
                            <div class="input-group" style="width:79%">
                                <input class="form-control file-input" name="actor_imgurl"
                                       value="<?= $actor_imgurl ?>">
                                <span class="input-group-btn">
                                        <a class="btn btn-secondary upload-file" href="javascript:"
                                           data-toggle="tooltip"
                                           data-placement="bottom" title="上传文件">
                                            <span class="iconfont icon-cloudupload"></span>
                                        </a>
                                    </span>
                                <span class="input-group-btn">
                                        <a class="btn btn-secondary select-file" href="javascript:"
                                           data-toggle="tooltip"
                                           data-placement="bottom" title="从文件库选择">
                                            <span class="iconfont icon-viewmodule"></span>
                                        </a>
                                    </span>
                                <span class="input-group-btn">
                                        <a class="btn btn-secondary delete-file" href="javascript:"
                                           data-toggle="tooltip"
                                           data-placement="bottom" title="删除文件">
                                            <span class="iconfont icon-close"></span>
                                        </a>
                                    </span>
                            </div>
                            <div class="upload-preview text-center upload-preview" >
                                <span class="upload-preview-tip">325&times;325</span>
                                <img class="upload-preview-img" src="<?= $actor_imgurl ?>">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group row" >
                <div class="form-group-label col-sm-3 text-right">
                    <label class=" col-form-label required">直播观看虚拟人数</label>
                </div>
                <div class="col-9">
                    <div class="input-group short-row" style="width:25%">
                        <input type="number" step="1" class="form-control"
                               name="number" min="1"
                               value="<?= $number ? $number : 1 ?>">
                        <span class="input-group-addon">个</span>
                    </div>
                </div>
            </div>
            <div class="form-group row" >
                <div class="form-group-label col-sm-3 text-right">
                    <label class=" col-form-label required">直播购物件数</label>
                </div>
                <div class="col-9">
                    <div class="input-group short-row" style="width:25%">
                        <input type="number" step="1" class="form-control "
                               name="total" min="1"
                               value="<?= $total ? $total : 1 ?>">
                        <span class="input-group-addon">件</span>
                    </div>
                </div>
            </div>
            <div class="form-group row" >
                <div class="form-group-label col-sm-3 text-right">
                    <label class=" col-form-label required">直播间名称</label>
                </div>
                <div class="col-9">
                    <div class="input-group short-row" style="width:25%">
                        <input type="text" class="form-control "
                               name="room_name"
                               value="<?= $room_name ?>">

                    </div>
                </div>
            </div>
            <div class="form-group row" >
                <div class="form-group-label col-sm-3 text-right">
                    <label class=" col-form-label required">主播名称</label>
                </div>
                <div class="col-9">
                    <div class="input-group short-row" style="width:25%">
                        <input type="text" step="1" class="form-control "
                               name="name"
                               value="<?= $name ?>">
                    </div>
                </div>
            </div>


            <div class="form-group row">
                <div class="form-group-label col-sm-2 text-right">
                </div>
                <div class="col-sm-6">
                    <a class="btn btn-primary auto-form-btn" href="javascript:">保存</a>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="<?php $url?>"></script>
<script type="text/javascript">
    laydate.render({
        elem: '#date_start'//指定元素
        ,type:'datetime'
    });
    laydate.render({
        elem: '#date_end'//指定元素
        ,type:'datetime'
    });
</script>
